home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine PD Edition 0
/
Amoszine PD Edition 0.adf
/
SOURCE_CODE
/
Bounding_Box.Amos
/
Bounding_Box.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1993-02-25
|
1KB
|
57 lines
Rem CrossHairs
'
' click left mouse button
' use mouse to draw bounding box
' click left mouse button again to end
Flash Off : Curs Off : Hide : Cls 0
Set Line %1111000011110000
Gr Writing 0
Repeat
If Key State(69) Then QUIT
X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
If OLDX<>X or OLDY<>Y
Bob 1,0,Y,1
Bob 2,X,0,2
OLDX=X : OLDY=Y
End If
If Mouse Key=1 and S=0 and X<>X2 and Y<>Y2
X1=X : Y1=Y
S=1
End If
If Mouse Key=1 and S>0 and X<>X1 and Y<>Y1
X2=X : Y2=Y
Bob Off : Wait Vbl
Ink 0 : Box X1,Y1 To XT,YT
Ink 2 : Box X1,Y1 To X2,Y2
S=0 : E=1
End If
If S>0 and X<>XT and Y<>YT
Bob Off : Wait Vbl
Ink 0 : Box X1,Y1 To XT,YT
Bob Off : Wait Vbl
Ink 2 : Box X1,Y1 To X,Y
XT=X : YT=Y
End If
Multi Wait
Until E>0 and Mouse Key
Cls 0 : Paper 0 : Print "Coordinates are: ";Str$(X1)-Chr$(32);",";Str$(Y1)-Chr$(32);" and ";Str$(X)-Chr$(32);",";Str$(Y)-Chr$(32)
Wait 150 : QUIT
Procedure QUIT
Default
Edit
End Proc